package homework.printyourself.info.items;

import homework.printyourself.info.BaseObject;
import homework.valid.validators.ValidateChain;
import homework.valid.validators.impl.RegularValidator;

import java.io.IOException;

public class ClassItem extends BaseInformationItem {

    static {
        chain = new ValidateChain();
        chain.addValidator(new RegularValidator("格式错误", "\\d{2,4}[^\\d]+\\d{1,4}班"));
    }

    public ClassItem(BaseObject obj) throws IOException {
        super(obj, null);
        itemValue = (String)fi.input("请输入班级[<届><专业><班级>班]: ", chain);
        itemName = "班级";
    }

    public ClassItem(BaseObject obj, String value) {
        super(obj, value);
        itemName = "班级";
    }
}
